package com.it.xx.demo;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎进入地铁管理程序");

        System.out.println("请输入您的工号:");
        Integer i =sc.nextInt();
        System.out.println("请输入你的名字:");
        String s = sc.next();
        BufferedReader br = new BufferedReader(new FileReader("exercise\\managers.txt"));

        switch (i) {
            case 10001:
                if (s.equals(br.readLine().split(",")[1])) {
                    System.out.println("欢迎小王管理员登录系统");
                    break;
                }
            case 10002:
                if (s.equals(br.readLine().split(",")[1])){
                    System.out.println("欢迎老于管理员登录系统");
                    break;
                }
            case 10003:
                if (s.equals(br.readLine().split(",")[1])){
                    System.out.println("欢迎老方管理员登录系统");
                    break;
                }
            default:
                System.out.println("你输入的工号或者姓名有误请重新输入");
                break;
        }
    }



}

/*    private static void getSystems(Integer i, String s) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("exercise\\managers.txt"));

        switch (i) {
            case 10001:
                if (s.equals(br.readLine().split(",")[1])) {
                    System.out.println("欢迎小王管理员登录系统");
                    break;
                }
            case 10002:
                if (s.equals(br.readLine().split(",")[1])){
                    System.out.println("欢迎老于管理员登录系统");
                    break;
                }
            case 10003:
                if (s.equals(br.readLine().split(",")[1])){
                    System.out.println("欢迎老方管理员登录系统");
                    break;
                }
            default:
                System.out.println("你输入的工号或者姓名有误请重新输入");
                break;
        }
    }
}*/

